package com.mercury.ec.framework.air.core.client.impl.sunstn.dto.detr;

import com.mercury.ec.framework.air.core.client.impl.sunstn.jaxb.adapter.Boolean2XmlAdapter;
import com.mercury.ec.framework.air.core.client.impl.sunstn.jaxb.adapter.DecodeHex2XmlAdapter;
import lombok.Data;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

/**
 * SUNSTN DETR Response DTO
 *
 * @author hesx
 */
@Data
@XmlRootElement(name = "cmd")
@XmlAccessorType(XmlAccessType.FIELD)
public class SunstnDetrRespDTO {
    /**
     * 编码提取结果，如果为 0，则表示该次请求失败
     */
    @XmlAttribute(name = "ret_value")
    @XmlJavaTypeAdapter(Boolean2XmlAdapter.class)
    private Boolean ret_value;

    /**
     * 错语信息
     */
    @XmlAttribute(name = "err_info")
    private String err_info;

    /**
     * 原文
     */
    @XmlJavaTypeAdapter(DecodeHex2XmlAdapter.class)
    private String raw_data;

    /**
     * 票号信息
     */
    @XmlElement(name = "ticket", type = SunstnDetrTicketRespDTO.class)
    private SunstnDetrTicketRespDTO ticket;
}
